package com.appwoo.txtws.component;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Environment;
import android.widget.Toast;
import java.io.File;
import java.util.Timer;

public class GlobalMod
{
  private static final int MINUTE_IN_MS = 15000;
  private static final String TAG = "GlobalMod";
  protected static boolean isOnline = true;
  private static boolean isRun;
  protected static boolean isScreenOn = true;
  private static Timer mDetectTimer;
  private Timer childTimer;
  protected Context pContext;
  protected ProgressDialog pDialog;
  protected PackageManager pPackageManager;
  protected boolean shouldDismissDialog;

  public GlobalMod()
  {
  }

  public GlobalMod(Context paramContext)
  {
    this.pContext = paramContext;
  }

  public void cancelDectection()
  {
    if (mDetectTimer != null)
    {
      mDetectTimer.purge();
      mDetectTimer.cancel();
    }
  }

  protected void createOrShowDialog(String paramString)
  {
    if ((this.pDialog == null) || (!this.pDialog.isShowing()))
    {
      this.pDialog = new ProgressDialog(this.pContext);
      this.pDialog.setMessage(paramString);
      this.pDialog.setCancelable(true);
      if (!this.pDialog.isShowing())
        this.pDialog.show();
    }
  }

  protected void dismissDialog()
  {
    if ((this.pDialog != null) && (this.pDialog.isShowing()))
    {
      this.pDialog.dismiss();
      this.pDialog = null;
    }
  }

  public String getString(int paramInt)
  {
    return this.pContext.getString(paramInt);
  }

  public boolean hasSDCard()
  {
    return Environment.getExternalStorageState().equals("mounted");
  }

  public void installApk(String paramString)
  {
    File localFile = new File(paramString);
    Intent localIntent = new Intent();
    localIntent.addFlags(268435456);
    localIntent.setAction("android.intent.action.VIEW");
    localIntent.setDataAndType(Uri.fromFile(localFile), "application/vnd.android.package-archive");
    this.pContext.startActivity(localIntent);
  }

  protected void makeSurePMExist()
  {
    if (this.pPackageManager == null)
      this.pPackageManager = this.pContext.getPackageManager();
  }

  protected void toast(String paramString)
  {
    toast(paramString, 0);
  }

  protected void toast(String paramString, int paramInt)
  {
    try
    {
      Toast localToast = Toast.makeText(this.pContext, paramString, paramInt);
      localToast.setGravity(16, 0, 0);
      localToast.show();
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.component.GlobalMod
 * JD-Core Version:    0.6.2
 */